imednet.models package

Models package for the iMedNet SDK.

This package contains all data models used by the SDK to represent iMedNet resources.

class imednet.models.AdverseEvent[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Adverse Event (AE) reporting model.

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].

class imednet.models.AnalysisAdverseEvent[source]

Bases: ImednetBaseModel

Analysis Adverse Event Dataset (ADAE).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

class imednet.models.AnalysisLabResult[source]

Bases: ImednetBaseModel

Analysis Lab Result Dataset (ADLB).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

class imednet.models.ApiResponse[source]

Bases: ImednetBaseModel, Generic[T]

Generic API response model.

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].

class imednet.models.BaseRecordRequest[source]

Bases: ImednetBaseModel

Base class for record creation/update requests.

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].

class imednet.models.Coding

Bases: Coding

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].

class imednet.models.CreateNewRecordRequest[source]

Bases: BaseRecordRequest

Payload for creating a new unscheduled record.

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].

class imednet.models.DeviceDeficiency[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Device Deficiency (DD) reporting model.

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].

class imednet.models.DeviceSafetyProfile[source]

Bases: StandardsProfile

Device safety profile including device deficiency (DD) requirements.

__init__()[source]

Initialize the device safety profile.

Return type:

None

validate(domain, data)[source]

Validate device-specific constraints for DD and other domains.

Return type:

list[ValidationViolation]

Parameters:
  • domain (str) –

  • data (dict[str, Any]) –

class imednet.models.DrugSafetyProfile[source]

Bases: StandardsProfile

Drug safety profile with stricter requirements for AE data.

__init__()[source]

Initialize the drug safety profile.

Return type:

None

class imednet.models.Error[source]

Bases: ImednetBaseModel

Error information in an API response.

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].

class imednet.models.Form

Bases: Form

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].

class imednet.models.FormStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of a form including its variables.

classmethod from_form(form, variables)[source]

Creates FormStructure from a Form model and its associated variables.

Return type:

FormStructure

Parameters:
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].

class imednet.models.FormSummary[source]

Bases: ImednetBaseModel

Minimal form details embedded within an interval definition.

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].

class imednet.models.GeneralClinicalProfile[source]

Bases: StandardsProfile

General clinical profile with basic AE and PD requirements.

__init__()[source]

Initialize the general clinical profile.

Return type:

None

class imednet.models.ImednetBaseModel[source]

Bases: BaseModel

Core base model for all iMedNet API responses.

Design philosophy: extra=’ignore’ silently drops new undocumented fields the API introduces. populate_by_name allows models to be instantiated using either pythonic snake_case names or original API camelCase names via Field aliases. str_strip_whitespace trims leading and trailing whitespace from string values.

classmethod from_json(data)[source]

Validate data coming from JSON APIs.

Return type:

Self

Parameters:

data (Any) –

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].

class imednet.models.Interval

Bases: 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].

class imednet.models.IntervalStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of an interval including its forms.

classmethod from_interval(interval, forms)[source]

Creates IntervalStructure from an Interval model and its associated FormStructures.

Return type:

IntervalStructure

Parameters:
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].

class imednet.models.Job

Bases: Job

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].

class imednet.models.JobStatus

Bases: JobStatus

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].

class imednet.models.Keyword

Bases: Keyword

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].

class imednet.models.MappingRule[source]

Bases: ImednetBaseModel

Mapping from raw source variable to canonical reporting field.

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].

class imednet.models.Metadata[source]

Bases: ImednetBaseModel

Metadata information in an API response.

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].

class imednet.models.Pagination[source]

Bases: ImednetBaseModel

Pagination information in an API response.

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].

class imednet.models.ProtocolDeviation[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Protocol Deviation (PD) reporting model.

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].

class imednet.models.Query

Bases: Query

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].

class imednet.models.QueryComment

Bases: QueryComment

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].

class imednet.models.Record

Bases: Record

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].

class imednet.models.RecordData[source]

Bases: RootModel[dict[str, Any]]

Arbitrary record data as a dictionary.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class imednet.models.RecordJobResponse[source]

Bases: ImednetBaseModel

Response for a record-related job (batch operations, etc).

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].

class imednet.models.RecordRevision

Bases: RecordRevision

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].

class imednet.models.RegisterSubjectRequest[source]

Bases: BaseRecordRequest

Payload for registering (enrolling) a new subject.

Per the API documentation, registering a subject only requires formKey and siteName. The system assigns the subject identifier upon creation. Do not include a subjectKey here — doing so causes the server to treat the request as an update and reject it when the key is unknown.

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].

class imednet.models.ResourceRegistry[source]

Bases: object

Unified resource governance registry serving as the single source of truth for fields.

classmethod get_fields(model_name)[source]

Get the field names for a specific dynamic model.

Parameters:

model_name (str) – The name of the model (e.g., ‘Subject’, ‘Record’).

Return type:

list[str]

Returns:

A list of field names in snake_case.

class imednet.models.Role

Bases: Role

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].

class imednet.models.Site

Bases: Site

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].

class imednet.models.SortField[source]

Bases: ImednetBaseModel

Sorting information for a field in a paginated response.

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].

class imednet.models.StandardsProfile[source]

Bases: object

A profile defining required, recommended, and optional fields for data domains.

__init__(*, profile_name, required_fields=None, recommended_fields=None, optional_fields=None, value_constraints=None)[source]

Initialize a standards profile.

Parameters:
  • profile_name (str) – Unique name for the profile.

  • required_fields (Optional[dict[str, list[str]]]) – Mapping of domain to required field names.

  • recommended_fields (Optional[dict[str, list[str]]]) – Mapping of domain to recommended field names.

  • optional_fields (Optional[dict[str, list[str]]]) – Mapping of domain to optional field names.

  • value_constraints (Optional[dict[str, list[Any]]]) – Mapping of field or domain.field to allowed values.

Return type:

None

expected_fields(domain)[source]

Return the list of expected (required + recommended) fields for a domain.

Return type:

list[str]

Parameters:

domain (str) –

validate(domain, data)[source]

Validate a data dictionary against the profile for a specific domain.

Parameters:
  • domain (str) – The domain name (e.g., ‘AE’, ‘PD’).

  • data (dict[str, Any]) – The data dictionary to validate.

Return type:

list[ValidationViolation]

Returns:

A list of ValidationViolation objects.

class imednet.models.StandardsProfileRegistry[source]

Bases: object

Registry for managing and retrieving standards profiles.

__init__()[source]

Initialize an empty profile registry.

Return type:

None

get(profile_name)[source]

Retrieve a profile by its name.

Return type:

StandardsProfile

Parameters:

profile_name (str) –

list_profiles()[source]

List all registered profile names.

Return type:

list[str]

register(profile)[source]

Register a new standards profile.

Return type:

None

Parameters:

profile (StandardsProfile) –

class imednet.models.Study

Bases: Study

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].

class imednet.models.StudyConfiguration[source]

Bases: ImednetBaseModel

Serialized study reporting dashboard configuration.

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].

class imednet.models.StudyStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of a full study including intervals and forms.

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].

class imednet.models.Subject

Bases: Subject

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].

class imednet.models.SubjectKeyword

Bases: SubjectKeyword

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].

class imednet.models.SubjectLevelAnalysis[source]

Bases: ImednetBaseModel

Subject-Level Analysis Dataset (ADSL).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

class imednet.models.TriageAnnotation[source]

Bases: ImednetBaseModel

Reviewer note attached to a triage item.

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].

class imednet.models.TriageHistoryEntry[source]

Bases: ImednetBaseModel

Status transition audit entry for a triage item.

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].

class imednet.models.TriageItem[source]

Bases: ImednetBaseModel

Core triage item used by queue and reviewer workflows.

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].

class imednet.models.TriageStatus[source]

Bases: str, Enum

Enumeration of possible triage statuses.

class imednet.models.UpdateScheduledRecordRequest[source]

Bases: BaseRecordRequest

Payload for updating an existing scheduled record.

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].

class imednet.models.User

Bases: User

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].

class imednet.models.ValidationViolation[source]

Bases: BaseModel

Represents a violation of a data standard constraint.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class imednet.models.Variable

Bases: Variable

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].

class imednet.models.Visit

Bases: Visit

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].

class imednet.models.WidgetConfig[source]

Bases: ImednetBaseModel

Declarative dashboard widget configuration.

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].

imednet.models.parse_bool(v)[source]

Normalize boolean values from various representations.

Accepts bool, str, int, float and returns a bool.

Defaults to False for unknown or unparsable types (e.g. None, [], object()). String representations like ‘1.0’, ‘inf’, and ‘nan’ are treated as truthy via float fallback.

Return type:

bool

Parameters:

v (Any) –

Example

>>> from imednet.utils.validators import parse_bool
>>> parse_bool("yes")
True
>>> parse_bool("1.0")
True
>>> parse_bool(None)
False
imednet.models.parse_datetime(v)[source]

Parse an ISO datetime string, numeric timestamp, or return a sentinel value.

The SDK historically returns datetime(1969, 4, 20, 16, 20) when a timestamp field is empty. This helper mirrors that behaviour for backward compatibility.

Parameters:

v (str | int | float | datetime) – Date string, numeric timestamp (seconds since epoch), or datetime object. Numeric values are assumed to be UTC timestamps.

Return type:

datetime

imednet.models.parse_dict_or_default(v, default_factory=<class 'dict'>)[source]

Normalize dictionary values, defaulting if None. Ensures result is a dict.

Return type:

dict[str, Any]

Parameters:
  • v (Any) –

  • default_factory (Callable[[], dict[str, Any]]) –

imednet.models.parse_int_or_default(v, default=0, strict=False)[source]

Normalize integer values, defaulting if None or empty string.

If strict=True, raise ValueError on parse failure.

Return type:

int

Parameters:
  • v (Any) –

  • default (int) –

  • strict (bool) –

imednet.models.parse_list_or_default(v, default_factory=<class 'list'>)[source]

Normalize list values, defaulting if None. Ensures result is a list.

Return type:

list[TypeVar(T)]

Parameters:
  • v (Any) –

  • default_factory (Callable[[], list[~T]]) –

imednet.models.parse_str_or_default(v, default='')[source]

Normalize string values, defaulting if None.

Return type:

str

Parameters:
  • v (Any) –

  • default (str) –

Submodules

imednet.models.base module

Base models for the iMedNet SDK.

class imednet.models.base.ApiResponse[source]

Bases: ImednetBaseModel, Generic[T]

Generic API response model.

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].

class imednet.models.base.Error[source]

Bases: ImednetBaseModel

Error information in an API response.

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].

class imednet.models.base.ImednetBaseModel[source]

Bases: BaseModel

Core base model for all iMedNet API responses.

Design philosophy: extra=’ignore’ silently drops new undocumented fields the API introduces. populate_by_name allows models to be instantiated using either pythonic snake_case names or original API camelCase names via Field aliases. str_strip_whitespace trims leading and trailing whitespace from string values.

classmethod from_json(data)[source]

Validate data coming from JSON APIs.

Return type:

Self

Parameters:

data (Any) –

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].

class imednet.models.base.Metadata[source]

Bases: ImednetBaseModel

Metadata information in an API response.

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].

class imednet.models.base.Pagination[source]

Bases: ImednetBaseModel

Pagination information in an API response.

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].

class imednet.models.base.SortField[source]

Bases: ImednetBaseModel

Sorting information for a field in a paginated response.

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].

imednet.models.codings module

Medical coding models for iMedNet.

imednet.models.contract module

Unified contract definitions.

class imednet.models.contract.APIContract[source]

Bases: BaseModel

Unified API Contract.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class imednet.models.contract.ContractBuilder[source]

Bases: object

Builder for APIContract.

__init__()[source]

Initialize.

Return type:

None

ingest_openapi(file_path)[source]

Ingest an OpenAPI specification JSON file.

Return type:

None

Parameters:

file_path (str) –

ingest_postman(file_path)[source]

Ingest a Postman collection JSON file.

Return type:

None

Parameters:

file_path (str) –

parse_postman_type(val)[source]

Map Postman placeholder strings to internal type names and defaults.

Return type:

tuple[str, Any]

Parameters:

val (Any) –

class imednet.models.contract.FieldDefinition[source]

Bases: BaseModel

Internal contract for a model field.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class imednet.models.contract.ModelDefinition[source]

Bases: BaseModel

Internal contract for a model.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

imednet.models.contract.to_snake(name)[source]

Convert camelCase or PascalCase strings to snake_case.

Return type:

str

Parameters:

name (str) –

imednet.models.engine module

Engine module.

class imednet.models.engine.ModelEngine[source]

Bases: object

Engine for dynamically creating Pydantic models from schemas.

classmethod generate_stubs(output_dir)[source]

Generate type stubs for dynamic models.

Return type:

None

Parameters:

output_dir (str) –

classmethod get_model(model_name, base_cls=<class 'imednet.models.base.ImednetBaseModel'>)[source]

Get or create a dynamic Pydantic model for the given name.

Parameters:
  • model_name (str) – The name of the model (e.g., ‘Subject’, ‘Record’).

  • base_cls (type[Any]) – The base class to inherit from.

Return type:

type[Any]

Returns:

A Pydantic model class.

class imednet.models.engine.ResourceRegistry[source]

Bases: object

Unified resource governance registry serving as the single source of truth for fields.

classmethod get_fields(model_name)[source]

Get the field names for a specific dynamic model.

Parameters:

model_name (str) – The name of the model (e.g., ‘Subject’, ‘Record’).

Return type:

list[str]

Returns:

A list of field names in snake_case.

imednet.models.engine.get_contract()[source]

Load API schema contracts lazily.

Return type:

APIContract

Returns:

The unified API contract.

imednet.models.engine.to_snake(name)[source]

Convert camelCase or PascalCase strings to snake_case.

Return type:

str

Parameters:

name (str) –

imednet.models.forms module

Form (eCRF) metadata models for iMedNet.

imednet.models.intervals module

Interval (visit definition) models for iMedNet.

class imednet.models.intervals.FormSummary[source]

Bases: ImednetBaseModel

Minimal form details embedded within an interval definition.

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].

imednet.models.jobs module

Job and background operation models for iMedNet.

imednet.models.queries module

Query and annotation models for iMedNet.

imednet.models.record_revisions module

Record revision history models for iMedNet.

imednet.models.records module

Record (eCRF instance) models for iMedNet.

class imednet.models.records.BaseRecordRequest[source]

Bases: ImednetBaseModel

Base class for record creation/update requests.

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].

class imednet.models.records.CreateNewRecordRequest[source]

Bases: BaseRecordRequest

Payload for creating a new unscheduled record.

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].

class imednet.models.records.RecordData[source]

Bases: RootModel[dict[str, Any]]

Arbitrary record data as a dictionary.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class imednet.models.records.RecordJobResponse[source]

Bases: ImednetBaseModel

Response for a record-related job (batch operations, etc).

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].

class imednet.models.records.RegisterSubjectRequest[source]

Bases: BaseRecordRequest

Payload for registering (enrolling) a new subject.

Per the API documentation, registering a subject only requires formKey and siteName. The system assigns the subject identifier upon creation. Do not include a subjectKey here — doing so causes the server to treat the request as an update and reject it when the key is unknown.

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].

class imednet.models.records.UpdateScheduledRecordRequest[source]

Bases: BaseRecordRequest

Payload for updating an existing scheduled record.

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].

imednet.models.reporting module

Reporting and analysis models for iMedNet, including CDISC-aligned datasets.

class imednet.models.reporting.AdverseEvent[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Adverse Event (AE) reporting model.

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].

class imednet.models.reporting.AnalysisAdverseEvent[source]

Bases: ImednetBaseModel

Analysis Adverse Event Dataset (ADAE).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

class imednet.models.reporting.AnalysisLabResult[source]

Bases: ImednetBaseModel

Analysis Lab Result Dataset (ADLB).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

class imednet.models.reporting.DeviceDeficiency[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Device Deficiency (DD) reporting model.

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].

class imednet.models.reporting.ProtocolDeviation[source]

Bases: ImednetBaseModel

Canonical CDISC-aligned Protocol Deviation (PD) reporting model.

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].

class imednet.models.reporting.SubjectLevelAnalysis[source]

Bases: ImednetBaseModel

Subject-Level Analysis Dataset (ADSL).

model_config: ClassVar[ConfigDict] = {'extra': 'allow', '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].

imednet.models.sites module

Site (study location) models for iMedNet.

imednet.models.standards module

Data standard profiles and validation models for clinical domains.

class imednet.models.standards.DeviceSafetyProfile[source]

Bases: StandardsProfile

Device safety profile including device deficiency (DD) requirements.

__init__()[source]

Initialize the device safety profile.

Return type:

None

validate(domain, data)[source]

Validate device-specific constraints for DD and other domains.

Return type:

list[ValidationViolation]

Parameters:
  • domain (str) –

  • data (dict[str, Any]) –

class imednet.models.standards.DrugSafetyProfile[source]

Bases: StandardsProfile

Drug safety profile with stricter requirements for AE data.

__init__()[source]

Initialize the drug safety profile.

Return type:

None

class imednet.models.standards.GeneralClinicalProfile[source]

Bases: StandardsProfile

General clinical profile with basic AE and PD requirements.

__init__()[source]

Initialize the general clinical profile.

Return type:

None

class imednet.models.standards.StandardsProfile[source]

Bases: object

A profile defining required, recommended, and optional fields for data domains.

__init__(*, profile_name, required_fields=None, recommended_fields=None, optional_fields=None, value_constraints=None)[source]

Initialize a standards profile.

Parameters:
  • profile_name (str) – Unique name for the profile.

  • required_fields (Optional[dict[str, list[str]]]) – Mapping of domain to required field names.

  • recommended_fields (Optional[dict[str, list[str]]]) – Mapping of domain to recommended field names.

  • optional_fields (Optional[dict[str, list[str]]]) – Mapping of domain to optional field names.

  • value_constraints (Optional[dict[str, list[Any]]]) – Mapping of field or domain.field to allowed values.

Return type:

None

expected_fields(domain)[source]

Return the list of expected (required + recommended) fields for a domain.

Return type:

list[str]

Parameters:

domain (str) –

validate(domain, data)[source]

Validate a data dictionary against the profile for a specific domain.

Parameters:
  • domain (str) – The domain name (e.g., ‘AE’, ‘PD’).

  • data (dict[str, Any]) – The data dictionary to validate.

Return type:

list[ValidationViolation]

Returns:

A list of ValidationViolation objects.

class imednet.models.standards.StandardsProfileRegistry[source]

Bases: object

Registry for managing and retrieving standards profiles.

__init__()[source]

Initialize an empty profile registry.

Return type:

None

get(profile_name)[source]

Retrieve a profile by its name.

Return type:

StandardsProfile

Parameters:

profile_name (str) –

list_profiles()[source]

List all registered profile names.

Return type:

list[str]

register(profile)[source]

Register a new standards profile.

Return type:

None

Parameters:

profile (StandardsProfile) –

class imednet.models.standards.ValidationViolation[source]

Bases: BaseModel

Represents a violation of a data standard constraint.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

imednet.models.studies module

Study metadata models for iMedNet.

imednet.models.study_config module

Study configuration models and validation.

This module provides Pydantic models for parsing and validating study configurations, including reporting profiles, widgets, and mapping rules.

class imednet.models.study_config.MappingRule[source]

Bases: ImednetBaseModel

Mapping from raw source variable to canonical reporting field.

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].

class imednet.models.study_config.StudyConfiguration[source]

Bases: ImednetBaseModel

Serialized study reporting dashboard configuration.

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].

class imednet.models.study_config.WidgetConfig[source]

Bases: ImednetBaseModel

Declarative dashboard widget configuration.

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].

imednet.models.study_structure module

Models for representing the hierarchical structure of a study.

class imednet.models.study_structure.FormStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of a form including its variables.

classmethod from_form(form, variables)[source]

Creates FormStructure from a Form model and its associated variables.

Return type:

FormStructure

Parameters:
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].

class imednet.models.study_structure.IntervalStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of an interval including its forms.

classmethod from_interval(interval, forms)[source]

Creates IntervalStructure from an Interval model and its associated FormStructures.

Return type:

IntervalStructure

Parameters:
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].

class imednet.models.study_structure.StudyStructure[source]

Bases: ImednetBaseModel

Hierarchical representation of a full study including intervals and forms.

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].

imednet.models.subjects module

Models for subjects and participant keywords.

imednet.models.triage module

Models for triage and reviewer workflows.

class imednet.models.triage.TriageAnnotation[source]

Bases: ImednetBaseModel

Reviewer note attached to a triage item.

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].

class imednet.models.triage.TriageHistoryEntry[source]

Bases: ImednetBaseModel

Status transition audit entry for a triage item.

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].

class imednet.models.triage.TriageItem[source]

Bases: ImednetBaseModel

Core triage item used by queue and reviewer workflows.

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].

class imednet.models.triage.TriageStatus[source]

Bases: str, Enum

Enumeration of possible triage statuses.

imednet.models.users module

Models for users and roles within iMedNet.

imednet.models.variables module

Models for form variables (data fields) in iMedNet.

imednet.models.visits module

Models for subject visits and study events.