0e2a5d92cf
The patient carries the menopausal state, molecular and clinical subtype, integrative cluster, cellularity, mutation load, Ki-67 category and source of the record; `seguimientomama` holds the recurrence and the last contact; hormone and anti-HER2 therapy are treatments, with an explicit "no treatment" value. One alembic revision on survival's chain, the catalog studies and the timeline entries. Includes the survival bronze and total-cohort work this builds on. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
75 lines
2.5 KiB
Python
75 lines
2.5 KiB
Python
from datetime import date
|
|
from typing import Optional
|
|
|
|
import sqlalchemy as sa
|
|
from sqlmodel import Field
|
|
from core.cama.base import CaMaModel
|
|
from core.columns import FileBlob, HOSPITAL_ID_LENGTH
|
|
|
|
class Mastografia(CaMaModel, table=True):
|
|
"""
|
|
Modelo ORM para mastografía.
|
|
"""
|
|
mast_id: Optional[int] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Integer, primary_key=True, autoincrement=True),
|
|
)
|
|
pac_id: Optional[int] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Integer, index=True),
|
|
description="join logico, resuelto por el loader via lookup en paciente.pac_id_hospital",
|
|
)
|
|
pac_id_hospital: str = Field(
|
|
sa_column=sa.Column(sa.String(HOSPITAL_ID_LENGTH), nullable=False, index=True),
|
|
description="identificador hospitalario, obligatorio para vincular estudios con pacientes",
|
|
)
|
|
ord_id: Optional[int] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Integer, sa.ForeignKey("ordenesestudio.ord_id"), index=True),
|
|
description="FK resuelto por el loader via lookup en ordenes_estudio.ord_numero_hospital",
|
|
)
|
|
ord_numero_hospital: Optional[int] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Integer, index=True),
|
|
description="numero de orden HIS, join logico hacia ordenes_estudio.ord_numero_hospital",
|
|
)
|
|
mast_fecha_toma: Optional[date] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Date),
|
|
)
|
|
mast_fecha_reporte: Optional[date] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Date),
|
|
)
|
|
mast_calidad_imagen: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
)
|
|
mast_birads: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
)
|
|
mast_dicom_blob: Optional[bytes] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(FileBlob),
|
|
)
|
|
mast_interpretacion: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
description="enlace o referencia a la interpretación del radiólogo; formato pendiente",
|
|
)
|
|
mast_densidad: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
)
|
|
mast_margen_masa: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
)
|
|
mast_tipo_hallazgo: Optional[str] = Field(
|
|
default=None,
|
|
sa_column=sa.Column(sa.Text),
|
|
)
|
|
|
|
|