18 lines
765 B
Python
18 lines
765 B
Python
"""Import schema for `core.tea.models.OrdenesEstudio`: the order of an ADOS-2, a neuropediatrics note or an EEG."""
|
|
from typing import Optional
|
|
|
|
from core.tea.enums import TIPO_ESTUDIO_ALIAS, TipoEstudio
|
|
from webapi.imports.schemas.base import ImportSchema
|
|
from webapi.imports.schemas.coercion import Catalog, CatalogValue, FlexDate, OptionalStr, SourceId
|
|
|
|
_TIPO_ESTUDIO_CATALOG = Catalog(TipoEstudio, TIPO_ESTUDIO_ALIAS)
|
|
|
|
|
|
class OrdenesEstudioImportSchema(ImportSchema):
|
|
# The source's own id, kept so rows that reference it by id still point at this record.
|
|
ord_id: SourceId = None
|
|
ord_pac_id: Optional[int] = None
|
|
ord_id_hospital: OptionalStr = None
|
|
ord_tipo_estudio: CatalogValue(_TIPO_ESTUDIO_CATALOG) = None
|
|
ord_fecha: FlexDate = None
|