pyhealth.data.Event#

One basic data structure in the package. It is a simple container for a single event. It contains all necessary attributes for supporting various healthcare tasks.

class pyhealth.data.Event(event_type, timestamp=None, **kwargs)[source]#

Bases: object

Event class representing a single clinical event.

event_type#

Type of the clinical event (e.g., ‘medication’, ‘diagnosis’)

Type:

str

timestamp#

When the event occurred

Type:

datetime

attr_dict#

Dictionary containing event-specific attributes

Type:

Mapping[str, any]

event_type: str#
timestamp: datetime#
attr_dict: Mapping[str, any]#
classmethod from_dict(d)[source]#

Create an Event instance from a dictionary.

Parameters:

d (Dict[str, any]) – Dictionary containing event data.

Returns:

An instance of the Event class.

Return type:

Event