Patient profiles are the central reference point for all clinical activity in Turnero. Every appointment, clinical visit, allergy record, vaccination, growth measurement, and medication entry is linked back to a single patient. Profiles store demographic information, contact details, insurance data, and blood type, and they serve as the entry point to the full patient history. The entire Patients module — including creating, viewing, editing, and searching — requires the Medico role.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
Field reference
| Field | Type | Validation | Description |
|---|---|---|---|
Id | Guid | Auto-generated | Primary key (from BaseEntity) |
Name | string | Required | Patient’s full name |
Dni | string | 6–10 chars, required | National identity document number |
BirthDate | DateTime | Required | Date of birth (dd/MM/yyyy display format) |
SocialWork | string | — | Health insurance plan name |
AffiliateNumber | string | — | Insurance membership / affiliate number |
BloodType | BloodType | Enum | ABO + Rh blood group |
ContactInfo | ContactInfo | — | Owned object with phone, email, address |
Patient.Dni is stored as string? with a [StringLength(10, MinimumLength = 6)] validation constraint, allowing for leading zeros or formatted document numbers. The PatientDTO used in list responses maps Dni to int? for compact serialisation. When creating or editing a patient, submit Dni as a string in the form body; the list endpoint will return it as an integer.BloodType enum
TheBloodType enum covers all eight standard ABO/Rh combinations. The [Display] attribute drives the dropdown labels in the UI.
| Enum value | Display label |
|---|---|
A_Positive | A+ |
A_Negative | A- |
B_Positive | B+ |
B_Negative | B- |
AB_Positive | AB+ |
AB_Negative | AB- |
O_Positive | O+ |
O_Negative | O- |
ContactInfo sub-object
ContactInfo is a separate owned entity linked one-to-one with a patient. It carries all contact details:
| Field | Type | Description |
|---|---|---|
Id | Guid | Auto-generated primary key |
Phone | string | Telephone number |
Email | string | Email address |
Address | string | Street address |
City | string | City |
PostalCode | string | Postal / ZIP code |
Role restriction
The entire
PatientsController is decorated with [Authorize(Roles = RolesConstants.Medico)]. Only authenticated users assigned the Medico role can access any patient management endpoint. Front-desk (Ingreso) and unauthenticated users will receive a 403 response.Patient list
The patient index (GET /Patients) displays a DataTables grid. Data is loaded via an AJAX initialization call:
Columns[1][search][value] parameter drives a server-side search against patient name and DNI. The response follows the standard DataTables envelope:
Creating a patient
Open the creation form:_Create partial view with a pre-populated BloodType dropdown built from the enum’s display names. Submit the form:
BloodType is submitted as the integer value of the enum member (e.g. 0 → A_Positive). Returns 200 OK on success, 400 Bad Request if the model state is invalid, or 409 Conflict on a data layer exception.
Editing a patient
Load the edit form with the current values pre-filled:__RequestVerificationToken).
Patient detail view
ViewBag.ParentsData— the linkedParentsDatarecord (father’s name, blood type, occupation; mother’s name, blood type, occupation; number of siblings).ViewBag.Age— a human-readable age string calculated at request time.
Age calculation logic
TheCalcularEdad helper converts BirthDate to a display string using the smallest meaningful unit:
| Condition | Returned string |
|---|---|
| ≥ 1 year | "N año(s)" — e.g. "3 años" |
| ≥ 1 month (< 1 year) | "N mes(es)" — e.g. "8 meses" |
| ≥ 7 days (< 1 month) | "N semana(s)" — e.g. "2 semanas" |
| < 7 days | "N día(s)" — e.g. "5 días" |
AddYears, months by AddMonths, and weeks/days by a simple TimeSpan.Days difference, each stepped back by one if the addition overshoots today’s date.
Relationships to other modules
APatient is the parent record for the following clinical entities:
Appointments (Turns)
Zero or more
Turn records, each representing a scheduled or walk-in visit.Clinical Visits
Zero or more
Visit records documenting diagnoses, treatments, and evolution notes.Allergies
A list of
Allergies entries with severity, type, and occurrence frequency.Vaccines
A collection of
Vaccines records with the vaccine name and date applied.Growth Charts
Longitudinal
GrowthChart entries tracking weight, height, head circumference, and BMI.Permanent Medications
A list of
PermMed entries for chronic or ongoing prescriptions.Personal Background
A single
PersonalBackground record with boolean flags for common medical history items.Perinatal Background
A single
PerinatalBackground record with birth measurements and gestational data.Parents Data
A single
ParentsData record with father’s and mother’s name, blood type, and occupation.Congenital Errors
A single
CongErrors record with neonatal screening results for metabolic conditions.