Skip to content

edsnlp.connectors.omop

OmopConnector [source]

Bases: object

[summary]

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline instance

TYPE: PipelineProtocol

start_char

Name of the column containing the start character index of the entity, by default "start_char"

TYPE: str DEFAULT: 'start_char'

end_char

Name of the column containing the end character index of the entity, by default "end_char"

TYPE: str DEFAULT: 'end_char'

preprocess [source]

Preprocess the input OMOP tables: modification of the column names.

Parameters

PARAMETER DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

RETURNS DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

postprocess [source]

Postprocess the input OMOP tables: modification of the column names.

Parameters

PARAMETER DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

RETURNS DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

omop2docs [source]

Transforms OMOP tables to a list of spaCy documents.

Parameters

PARAMETER DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

extensions

Extensions to keep, by default None

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
List[Doc]

List of spaCy documents.

docs2omop [source]

Transforms a list of spaCy documents to a pair of OMOP tables.

Parameters

PARAMETER DESCRIPTION
docs

List of spaCy documents.

TYPE: List[Doc]

extensions

Extensions to keep, by default None

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
note

OMOP note table.

TYPE: DataFrame

note_nlp

OMOP note_nlp table.

TYPE: DataFrame

omop2docs [source]

Transforms an OMOP-formatted pair of dataframes into a list of documents.

Parameters

PARAMETER DESCRIPTION
note

The OMOP note table.

TYPE: DataFrame

note_nlp

The OMOP note_nlp table

TYPE: DataFrame

nlp

The pipeline instance

TYPE: PipelineProtocol

extensions

Extensions to keep, by default None

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
List[Doc] :

List of spaCy documents

docs2omop [source]

Transforms a list of spaCy docs to a pair of OMOP tables.

Parameters

PARAMETER DESCRIPTION
docs

List of documents to transform.

TYPE: List[Doc]

extensions

Extensions to keep, by default None

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
Tuple[DataFrame, DataFrame]

Pair of OMOP tables (note and note_nlp)