Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pabloeferreyra/Turnero/llms.txt
Use this file to discover all available pages before exploring further.
The Patient entity is the central object in Turnero’s medical record system. Every clinical sub-module — visits, allergies, vaccines, growth measurements, medications, and background histories — is linked to a patient via a foreign key relationship. This page documents every model in Turnero’s DAL that relates to patient data, including the supporting enum types.
Base Types
BaseEntity
All primary entities inherit from BaseEntity, which provides a database-generated Guid primary key.
public abstract class BaseEntity
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
}
PatientFKEntity
PatientFKEntity is used for entities that share the same primary key as their parent Patient — the patient’s Id is both the PK and the FK on these entities (one-to-one relationship).
public class PatientFKEntity
{
[Key]
[ForeignKey(nameof(Patient))]
public Guid Id { get; set; }
}
Entities using PatientFKEntity: PersonalBackground, PerinatalBackground, CongErrors, ParentsData.
Patient
Patient extends BaseEntity and holds the core demographic and administrative data for a clinic patient.
public class Patient : BaseEntity
{
[Display(Name = "Nombre"), Required]
public string? Name { get; set; }
[StringLength(10, MinimumLength = 6), Required]
public string? Dni { get; set; }
[Display(Name = "Fecha de Nacimiento"), Required]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateTime BirthDate { get; set; }
public ContactInfo? ContactInfo { get; set; }
[Display(Name = "Obra Social")]
public string? SocialWork { get; set; }
[Display(Name = "Número de Afiliado")]
public string? AffiliateNumber { get; set; }
[Display(Name = "Grupo Sanguineo")]
public BloodType BloodType { get; set; }
public ICollection<Turn>? Turns { get; set; }
public ICollection<Visit>? Visits { get; set; }
public ParentsData? Parent { get; set; }
public PersonalBackground? PersonalBackground { get; set; }
public PerinatalBackground? PerinatalBackground { get; set; }
public ICollection<Vaccines>? Vaccines { get; set; }
public ICollection<Allergies>? Allergies { get; set; }
public ICollection<PermMed>? PermMeds { get; set; }
public ICollection<GrowthChart>? GrowthCharts { get; set; }
public CongErrors? CongErrors { get; set; }
}
| Field | Type | Notes |
|---|
Id | Guid | PK, inherited from BaseEntity |
Name | string? | Required. Patient full name. |
Dni | string? | Required. 6–10 character national ID number. |
BirthDate | DateTime | Required. Stored as SQL date. |
ContactInfo | ContactInfo? | One-to-one navigation. Optional. |
SocialWork | string? | Health insurance provider name. |
AffiliateNumber | string? | Insurance affiliate/membership number. |
BloodType | BloodType | Enum. See values below. |
PatientDTO
Lean projection used in DataTables list views.
public class PatientDTO : BaseEntity
{
public string? Name { get; set; }
public int? Dni { get; set; }
public string? BirthDate { get; set; }
public string? SocialWork { get; set; }
public string? AffiliateNumber { get; set; }
}
public class ContactInfo : BaseEntity
{
public string? Phone { get; set; }
public string? Email { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public string? PostalCode { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
}
BloodType Enum
| Value | Integer | Display |
|---|
A_Positive | 0 | A+ |
A_Negative | 1 | A- |
B_Positive | 2 | B+ |
B_Negative | 3 | B- |
AB_Positive | 4 | AB+ |
AB_Negative | 5 | AB- |
O_Positive | 6 | O+ |
O_Negative | 7 | O- |
Visit
Records a clinical encounter between a doctor and a patient. All string fields default to "" in the database (configured in ApplicationDbContext.OnModelCreating). VisitDate is stored as SQL date.
public class Visit : BaseEntity
{
public DateTime VisitDate { get; set; }
public string? Reason { get; set; }
public string? Diagnosis { get; set; }
public string? DiagDescription { get; set; }
public string? Treatment { get; set; }
public Guid PatientId { get; set; }
public Patient? Patient { get; set; }
public Guid MedicId { get; set; }
public Medic? Medic { get; set; }
public string? EvolutionNotes { get; set; }
public string? LabResults { get; set; }
public string? OtherStudies { get; set; }
public string? Observations { get; set; }
}
| Field | Type | Notes |
|---|
VisitDate | DateTime | SQL date column. |
Reason | string? | Chief complaint / reason for visit. |
Diagnosis | string? | Diagnosis code or label. |
DiagDescription | string? | Narrative description of the diagnosis. |
Treatment | string? | Prescribed treatment plan. |
EvolutionNotes | string? | Clinical evolution notes. |
LabResults | string? | Summary of laboratory results. |
OtherStudies | string? | Imaging or other ancillary studies. |
Observations | string? | Free-text observations. |
MedicId | Guid | Automatically set from the logged-in doctor. |
VisitDTO
public class VisitDTO : BaseEntity
{
public string? VisitDate { get; set; }
public string? Reason { get; set; }
public Guid PatientId { get; set; }
public string? Medic { get; set; }
}
Allergies
Records a patient allergy with severity, type, occurrence frequency, and date range.
public class Allergies : BaseEntity
{
[Display(Name = "Alergia"), Required]
public string? Name { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
public DateOnly Begin { get; set; }
public DateOnly? End { get; set; }
public string? Description { get; set; }
public Severity Severity { get; set; }
public AllergyType Type { get; set; }
public Occurrency Occurrency { get; set; }
public string? Comments { get; set; }
}
| Field | Type | Notes |
|---|
Name | string? | Required. Name of the allergen. |
Begin | DateOnly | Date the allergy was first observed. Stored as SQL date. |
End | DateOnly? | Date the allergy resolved (null = ongoing). |
Description | string? | Clinical description. |
Severity | Severity | Enum. See values below. |
Type | AllergyType | Enum. See values below. |
Occurrency | Occurrency | Enum. See values below. |
Comments | string? | Additional comments. |
Severity Enum
| Value | Description |
|---|
Ninguna | None |
Minima | Minimal |
Baja | Low |
Media | Moderate |
Alta | High |
Severa | Severe |
Critica | Critical |
Fatal | Fatal |
AllergyType Enum
| Value | Description |
|---|
Comida | Food |
Medicina | Medicine/drug |
Ambiental | Environmental |
Insecto | Insect |
Otra | Other |
Occurrency Enum
| Value | Description |
|---|
Una | One-time |
Sporadica | Sporadic |
Frequente | Frequent |
Constante | Constant |
Vaccines
Records a single vaccine administration for a patient.
public class Vaccines : BaseEntity
{
public string? Description { get; set; }
public DateOnly? DateApplied { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
}
public class VaccinesDto : BaseEntity
{
public string? Description { get; set; }
public string? OtherDescription { get; set; }
public DateOnly? DateApplied { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
}
VaccinesEnum
| Value | Integer | Description |
|---|
BCG | 0 | BCG (tuberculosis) |
Sabin | 1 | Oral polio (Sabin) |
HepatitisB | 2 | Hepatitis B |
DPT | 3 | Diphtheria-Pertussis-Tetanus |
HIB | 4 | Haemophilus influenzae type B |
PRS | 5 | Measles-Rubella-Mumps (Triple Viral) |
DTa | 6 | Acellular Diphtheria-Tetanus |
HepatitisA | 7 | Hepatitis A |
Otra | -1 | Other (free text in OtherDescription) |
GrowthChart
Records a growth measurement taken at a visit. Decimal precision is enforced at the EF level using [Precision] attributes.
public class GrowthChart : BaseEntity
{
[Precision(6, 3)]
public decimal Age { get; set; }
public string? Time { get; set; }
[Precision(13, 3)]
public decimal Weight { get; set; }
public string? WPerc { get; set; }
[Precision(13, 3)]
public decimal Height { get; set; }
public string? HPerc { get; set; }
[Precision(13, 3)]
public decimal HeadCircumference { get; set; }
public string? HCPerc { get; set; }
[Precision(13, 3)]
public decimal Bmi { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
}
| Field | Type | Precision | Description |
|---|
Age | decimal | (6,3) | Age in years at measurement (e.g. 1.500 = 18 months) |
Time | string? | — | Free-text label for measurement period |
Weight | decimal | (13,3) | Weight in kilograms |
WPerc | string? | — | Weight percentile (free text, e.g. "P50") |
Height | decimal | (13,3) | Height/length in centimeters |
HPerc | string? | — | Height percentile |
HeadCircumference | decimal | (13,3) | Head circumference in centimeters |
HCPerc | string? | — | Head circumference percentile |
Bmi | decimal | (13,3) | Body mass index |
PermMed (Permanent Medication)
A single ongoing medication entry for a patient.
public class PermMed : BaseEntity
{
public string? Description { get; set; }
public Patient? Patient { get; set; }
public Guid PatientId { get; set; }
}
Description is a free-text field capturing the medication name and dosage. There is no update endpoint — to modify a permanent medication, delete the entry and create a new one.
PersonalBackground
Tracks the patient’s personal medical history as a set of boolean flags plus a free-text Other field. Inherits from PatientFKEntity (shares the patient’s Id as its own PK). All boolean fields default to false in the database.
public class PersonalBackground : PatientFKEntity
{
public bool Asthma { get; set; }
public bool Allergy { get; set; }
public bool Pulmonologist { get; set; }
public bool Pneumonia { get; set; }
public bool Mumps { get; set; }
public bool Psicologicals { get; set; }
public bool Accidents { get; set; }
public bool HematOnc { get; set; }
public bool Rubella { get; set; }
public bool Otitis { get; set; }
public bool Measles { get; set; }
public bool Chickenpox { get; set; }
public bool UrinaryInfections { get; set; }
public bool Surgeries { get; set; }
public bool Diabetes { get; set; }
public bool Digestive { get; set; }
public string? Other { get; set; }
public Patient Patient { get; set; }
}
| Field | Display Name |
|---|
Asthma | Asma |
Allergy | Alergias |
Pulmonologist | Neumonológicos |
Pneumonia | Neumonías |
Mumps | Paperas |
Psicologicals | Psicologicos |
Accidents | Accidentes |
HematOnc | Hematooncológicos |
Rubella | Rubeola |
Otitis | Otítis |
Measles | Sarampión |
Chickenpox | Varicela |
UrinaryInfections | Infec. Urinarias |
Surgeries | Cirugías |
Diabetes | Diabetes |
Digestive | Digestivos |
Other | Otros – Especificar |
PerinatalBackground
Obstetric and birth history data. Inherits from PatientFKEntity. All integer fields default to 0 in the database.
public class PerinatalBackground : PatientFKEntity
{
public int Feat { get; set; } // Gesta
public int Delivery { get; set; } // Parto
public int Cesarean { get; set; } // Cesárea
public int Abort { get; set; } // Aborto
public int Weight { get; set; } // Peso al nacer (grams)
public int Height { get; set; } // Talla al nacer (mm)
public int CefPer { get; set; } // Perímetro Cefálico (mm)
public int Apgar1 { get; set; } // Apgar score at 1 minute
public int Apgar5 { get; set; } // Apgar score at 5 minutes
public int GestAge { get; set; } // Gestational age (weeks)
public string? Pathologies { get; set; }
public string? CongErrors { get; set; }
public Patient Patient { get; set; }
}
CongErrors (Congenital Error Screening)
Stores results from the mandatory neonatal metabolic screening panel. Inherits from PatientFKEntity. Each condition has a boolean presence flag and a string result field that accepts the CongErrorsResults constants.
public class CongErrors : PatientFKEntity
{
public bool CongHypothyroidism { get; set; }
public string? ResultHypothyroidism { get; set; }
public bool Phenylalanine { get; set; }
public string? ResultPhenylalanine { get; set; }
public bool FQP { get; set; }
public string? ResultFQP { get; set; }
public string? Other { get; set; }
public bool Biotinidase { get; set; }
public string? ResultBiotinidase { get; set; }
public bool Galactosemia { get; set; }
public string? ResultGalactosemia { get; set; }
public bool OHP { get; set; }
public string? ResultOHP { get; set; }
public Patient Patient { get; set; }
}
public class CongErrorsResults
{
public const string NA = "-";
public const string Normal = "Normal";
public const string Patological = "Patológico";
}
| Condition | Flag | Result Field | Display Name |
|---|
| Congenital hypothyroidism | CongHypothyroidism | ResultHypothyroidism | Hipotiroidismo congénito |
| Phenylketonuria | Phenylalanine | ResultPhenylalanine | Fenilcetonuria |
| Cystic fibrosis of pancreas | FQP | ResultFQP | Fibrosis quística del páncreas |
| Biotinidase deficiency | Biotinidase | ResultBiotinidase | Deficiencia de biotinidasa |
| Galactosemia | Galactosemia | ResultGalactosemia | Galactosemia |
| 17-OH Progesterone | OHP | ResultOHP | 17O Hidroxiprogesterona Neo |
Result values use CongErrorsResults constants: "-" (not applicable), "Normal", or "Patológico".
ParentsData
Demographic data for the patient’s parents. Inherits from PatientFKEntity. String fields default to "", date fields default to DateOnly.MinValue, integer fields default to 0.
public class ParentsData : PatientFKEntity
{
public string? FatherName { get; set; }
public DateOnly FatherBirthDate { get; set; }
public BloodType FatherBloodType { get; set; }
public string? FatherWork { get; set; }
public string? MotherName { get; set; }
public DateOnly MotherBirthDate { get; set; }
public BloodType MotherBloodType { get; set; }
public string? MotherWork { get; set; }
public int BrothersCount { get; set; }
public Patient Patient { get; set; }
}
ParentsData is loaded alongside the patient in GET /Patients/Details/{id} and placed in ViewBag.ParentsData for the detail view.