"""Import schema for `core.tea.models.Pacientes`. All fields optional, like TEA's Core; system-managed `pac_created_at`/`pac_updated_at`/`pac_fuente_sistema` are excluded. `pac_id` is importable: every other TEA table references the patient by the source system's integer id, so it has to be kept, not renumbered.""" from typing import Optional from core.tea.enums import Parentesco, SexoBiologico from webapi.imports.schemas.base import ImportSchema from webapi.imports.schemas.coercion import Catalog, CatalogValue, FlexDate, OptionalStr _SEXO_CATALOG = Catalog(SexoBiologico) _PARENTESCO_CATALOG = Catalog(Parentesco) class PacientesImportSchema(ImportSchema): pac_id: Optional[int] = None pac_id_hospital: OptionalStr = None pac_id_titular: OptionalStr = None pac_parentesco: CatalogValue(_PARENTESCO_CATALOG) = None pac_fecha_nacimiento: FlexDate = None pac_sexo: CatalogValue(_SEXO_CATALOG) = None pac_codigo_postal_vigente: OptionalStr = None pac_dependencia: OptionalStr = None