This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from abc import ABC | ||
|
||
from icu_pipeline.mapper.source import AbstractSourceMapper, DataSource | ||
from icu_pipeline.mapper.schema.fhir import AbstractFHIRSinkSchema | ||
from icu_pipeline.mapper.schema.ohdsi import AbstractOHDSISinkSchema | ||
from icu_pipeline.mapper.sink import AbstractSinkMapper, MappingFormat | ||
from icu_pipeline.mapper.source import SourceMapperConfiguration, DataSource | ||
|
||
|
||
class AbstractSnomedConcept(ABC): | ||
SNOMED_ID: str | ||
FHIR_SCHEMA: AbstractFHIRSinkSchema | ||
OHDSI_SCHEMA: AbstractOHDSISinkSchema | ||
MAPPER: dict[DataSource, AbstractSourceMapper] | ||
|
||
def __init__( | ||
self, | ||
sink_mapper: AbstractSinkMapper, | ||
mapping_format: MappingFormat, | ||
source_mapper_configs: dict[DataSource, SourceMapperConfiguration], | ||
) -> None: | ||
super().__init__() | ||
|
||
self._sink_mapper = sink_mapper | ||
self._mapping_format = mapping_format | ||
self._source_mapper_configs = source_mapper_configs | ||
|
||
def map(self): | ||
for source, source_mapper in self.MAPPER.items(): | ||
mapper = source_mapper( | ||
self.SNOMED_ID, | ||
self.FHIR_SCHEMA, | ||
self.OHDSI_SCHEMA, | ||
self._source_mapper_configs[source], | ||
self._sink_mapper, | ||
self._mapping_format, | ||
) | ||
|
||
mapper.map() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from icu_pipeline.concept import AbstractSnomedConcept | ||
from icu_pipeline.mapper.schema.fhir import FHIRObservation | ||
from icu_pipeline.mapper.schema.ohdsi import AbstractOHDSISinkSchema | ||
from icu_pipeline.mapper.source import DataSource | ||
from icu_pipeline.mapper.source.mimic.labevents import MimicSerumCreatinineMapper | ||
|
||
|
||
class SerumCreatinine(AbstractSnomedConcept): | ||
SNOMED_ID = "113075003" | ||
FHIR_SCHEMA = FHIRObservation | ||
OHDSI_SCHEMA = AbstractOHDSISinkSchema | ||
MAPPER = {DataSource.MIMIC: MimicSerumCreatinineMapper} |